<template>
  <div class='container'>

<el-dialog title="" >
  <el-form>
    <el-form-item label="目录名称" label-width="formLabelWidth">
      <el-select  placeholder="请选择">
        <el-option v-for="item in subjectList" :label="item.subjectName" :value="item.id" :key="item.id"></el-option>
      </el-select>
    </el-form-item>
  </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button >取 消</el-button>
    <el-button type="primary" >确 定</el-button>
  </div>
</el-dialog>
            <el-dialog title="" :visible="isDialog">
          <el-form>
            <el-form-item label="所属学科" label-width="80px">
              <el-select placeholder="请选择">
               <el-option v-for="item in subjectList" :label="item.subjectName" :value="item.id" :key="item.id"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="目录名称" label-width="80px">
              <el-input autocomplete="off"></el-input>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button >取 消</el-button>
            <el-button type="primary">确 定</el-button>
          </div>
        </el-dialog>
  </div>
</template>

<script>
import { list } from '@/api/hmmm/subjects'
export default {
  data () {
    return {
      subjectList: []
    }
  },
  props: {
    isDialog: {
      Type: Boolean
    }
  },
  computed: {
    titleType () {
      let title = ''
      if (this.eventType === 'add') title = '新增目录'
      if (this.eventType === 'edit') title = '修改目录'
      return title
    }
  },
  created () {
    this.getsubjectList()
  },
  methods: {
    async  getsubjectList () {
      const { data } = await list()
      console.log(data, '学科')
      this.subjectList = data.item
    },
    closeFn () {
      // this.$refs.form.resetFields()
      this.isDialog = false
    }
  }
}
</script>

<style scoped ></style>
